package com.ruoyi.order.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.ruoyi.order.domain.OrderGoods;
import com.ruoyi.order.mapper.OrderGoodsMapper;
import com.ruoyi.order.service.IOrderGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 订单卖品Service业务层处理
 *
 * @author HHAOYU
 * @date 2021-01-12
 */
@Service
public class OrderGoodsServiceImpl extends ServiceImpl<OrderGoodsMapper, OrderGoods> implements IOrderGoodsService {
    @Autowired
    private OrderGoodsMapper orderGoodsMapper;

    /**
     * 查询订单卖品
     *
     * @param id 订单卖品ID
     * @return 订单卖品
     */
    @Override
    public OrderGoods selectOrderGoodsById(Long id)
    {
        return orderGoodsMapper.selectOrderGoodsById(id);
    }

    /**
     * 查询订单卖品列表
     *
     * @param orderGoods 订单卖品
     * @return 订单卖品
     */
    @Override
    public List<OrderGoods> selectOrderGoodsList(OrderGoods orderGoods)
    {
        return orderGoodsMapper.selectOrderGoodsList(orderGoods);
    }

    /**
     * 新增订单卖品
     *
     * @param orderGoods 订单卖品
     * @return 结果
     */
    @Override
    public int insertOrderGoods(OrderGoods orderGoods)
    {
        return orderGoodsMapper.insertOrderGoods(orderGoods);
    }

    /**
     * 修改订单卖品
     *
     * @param orderGoods 订单卖品
     * @return 结果
     */
    @Override
    public int updateOrderGoods(OrderGoods orderGoods)
    {
        return orderGoodsMapper.updateOrderGoods(orderGoods);
    }

    /**
     * 批量删除订单卖品
     *
     * @param ids 需要删除的订单卖品ID
     * @return 结果
     */
    @Override
    public int deleteOrderGoodsByIds(Long[] ids)
    {
        return orderGoodsMapper.deleteOrderGoodsByIds(ids);
    }

    /**
     * 删除订单卖品信息
     *
     * @param id 订单卖品ID
     * @return 结果
     */
    @Override
    public int deleteOrderGoodsById(Long id)
    {
        return orderGoodsMapper.deleteOrderGoodsById(id);
    }
}
